<template>
  <div class="PageContainer">
    <div class="nav">
      <div class="logoTop" @click="toHome">
        <h1>SZY-UI</h1>
        <img src="./../assets/imgae/img2.jpg" alt="" />
      </div>
      <div class="navList">
        <div class="subTitle">组件列表</div>
        <ol>
          <li>
            <router-link to="/doc/button">Button 组件</router-link>
          </li>
          <li>
            <router-link to="/doc/card">Card 组件</router-link>
          </li>
          <li>
            <router-link to="/doc/clock">Clock 组件</router-link>
          </li>
          <li>
            <router-link to="/doc/input">Input 组件</router-link>
          </li>
          <li>
            <router-link to="/doc/link">Link 组件</router-link>
          </li>
          <li>
            <router-link to="/doc/switch">Switch 组件</router-link>
          </li>
          <li>
            <router-link to="/doc/dialog">Dialog 组件</router-link>
          </li>
          <li>
            <router-link to="/doc/radio">Radio 组件</router-link>
          </li>
        </ol>
      </div>
    </div>
    <div class="content">
      <div class="float">
        <router-view></router-view>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from "vue-router";

const router = useRouter();
const toHome = () => {
  router.push("/");
};
</script>

<style scoped lang="scss">
$bgcBlue: #514fdf;
$navGray: #000000;
// 混入flexCenterRow 相当于是一个类名 实现垂直水平居中
@mixin flexCenterRow {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}

@mixin flexCenterColumn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.PageContainer {
  min-height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  .nav {
    // background-color: rgb(179, 204, 179);
    width: 15vw;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    .logoTop {
      color: white;
      font-size: 25px;
      padding-bottom: 20px;
      width: 25vw;
      // height: 20vh;
      height: 260px;

      background-color: $navGray;
      @include flexCenterColumn;

      img {
        border-radius: 38px;
        margin-top: 10px;
        height: 130px;
        // width: 180px;
      }
    }
    .navList {
      width: 15vw;
      height: 65vh;
      padding-top: 30px;
      background-color: #fff;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      align-items: flex-start;
      ol {
        width: 100%;
        font-size: 18px;
        li {
          a {
            display: block;
            padding: 25px 60px;
          }
          .router-link-active {
            background-color: #4140f3;
            color: #fff;
          }
        }
      }
      .subTitle {
        font-size: 30px;
        font-weight: 900;
        display: flex;
        border-bottom: 2 solid gray;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        height: 50px;
        width: 15vw;
        padding-left: 35px;
        margin-bottom: 30px;
        // background-color: rgb(231, 223, 223);
      }
    }
    .logoBottom {
      width: 20vw;
      height: 15vh;
      background-color: $navGray;
    }
  }
  .content {
    width: 85vw;
    min-height: 100vh;
    background-color: rgb(226, 226, 226);
    @include flexCenterColumn();
    .float {
      box-shadow: 15px -5px 20px 5px rgba(0, 0, 0, 0.5);
      background-color: rgb(255, 255, 255);
      margin-top: 30px;
      width: 78vw;
      margin-left: -2%;
      margin-bottom: 50px;
    }
  }
}
</style>
